import request from '../utils/request';
// import { useTokenStore } from '../stores/token';

//学生登录
export const studentLoginService = (loginData) => {
    const parms = new URLSearchParams();          
    for(let key in loginData){
        parms.append(key,loginData[key]);
    }
    return request.post('/student/login',parms);
}
// 学生名单查询
export const getStudentService = () => {
    return request.get('/student')
}
// 学生id查询
export const getStudentByIdService = (id) => {
    return request.get('/student/'+id)
}
// 学生数据新增
export const addStudentService = (data) => {
    return request.post('/student/add', data)
}

export const deleteService = (id) => {
    return request.delete('/student/'+id)
}

// 学生数据修改
export const updateStudentService = (data) => {
    return request.put('/student/update', data)
}

//学生信息
export const getStudentDataService = () => {
    return request.get('/student/studentInfo')
}